﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="MarkControle.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Diaria
</asp:Content>

<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Agenda Diária</h2><h3><%:(string)Session["erroatualiza"]%></h3><%Session["erroatualiza"] = null;%>
    <body> <style type="text/css">h3{ color:Red;}
               .style1
               {
                   width: 75px;
                   height: 46px;
               }
               .style2
               {
                   width: 294px;
                   height: 46px;
               }
               .style3
               {
                   width: 59px;
                   height: 46px;
               }
               .style4
               {
                   width: 95px;
                   height: 46px;
               }
               .style5
               {
                   height: 46px;
               }
               .style7
               {
                   width: 133px;
                   height: 67px;
               }
               .style8
               {
                   width: 570px;
                   height: 67px;
               }
               .style9
               {
                   width: 156px;
                   height: 67px;
               }
               .style10
               {
                   width: 225px;
                   height: 67px;
               }
               .style11
               {
                   width: 198px;
                   height: 67px;
               }
               .style12
               {
                   width: 352px;
                   height: 67px;
               }
               .style13
               {
                   height: 67px;
               }
           </style><br /><%:Html.ActionLink("Voltar","Voltar")%>
    
    <% List<tarefa> tarefas = new List<tarefa>(); tarefas = (List<tarefa>)ViewData["listtarefas"]; tarefas.Sort();%>
    <table>
    <tr>
    <td style="width: 70px; height: 23px;"></td>
    <td style="width: 133px; height: 23px;">Prazo</td>
    <td style="width: 570px; height: 23px;">Informações</td>
    <td style="width: 156px; height: 23px;">Responsáveis</td>
    <td style="width: 225px; height: 23px;">Data Requisição</td>
    <td style="width: 198px; height: 23px;">Status</td>
    <td style="width: 352px; height: 23px;">Comentários</td>
    </tr>

     <%Session["temporio"] = tarefas; %><%int a = 0;%><%Session["volta"] = "D"; %>
    <%foreach (tarefa tarif in tarefas)
      {%><%using (Html.BeginForm("Editarif", "Home",FormMethod.Post)){%>
     <%string[] enc = new string[4]; enc = tarif.Encarregados; tarif.Enca1 = enc[0]; tarif.Enca2 = enc[1]; tarif.Enca3 = enc[2]; %>    
   
      <%string del = "Delete(" + a.ToString() + ")";%>
    <tr>
    <th class="style13"><input type="submit" name="input" value="<%:del%>" /></th>
    <th class="style7"><%=tarif.Prazo.Date%></th>
    <th class="style8"><%=tarif.Informacoes%></th>
    <th class="style9"><%=tarif.Encarregados[0] + "/" + tarif.Encarregados[1] + "/" + tarif.Encarregados[2]%></th>
    <th class="style10"><%=tarif.Datarequisicao.Date%></th>
    <th class="style11"><%if (tarif.Status1 == 0)
                               {%>Pendente<%}
                               else if (tarif.Status1 == 1)
                               {%>Adiada<%}
                               else if (tarif.Status1 == 2)
                               {%>Atrasada<%}
                               else
                               {%>Cumprida<%}%></th>
    <th class="style12"><%=tarif.Comentarios%></th>
    </tr>
          <%string dia = "Dia" + a.ToString(); %>
          <%string mes = "Mes" + a.ToString(); %>
          <%string ano = "Ano" + a.ToString();%>
          <%string atualiza = "Atualiza("+a.ToString()+")";%>
            
    <tr>
    <td class="style1"><input type="submit" name="input" value="<%:atualiza%>" /></td>
    <td class="style2"><%:Html.TextArea("coment"+a.ToString())%><%:Html.ValidationMessage("coment"+a.ToString())%><%:Html.ValidationMessage("erreadia"+a.ToString())%></td>
    <td class="style3"><%:Html.RadioButton("opcao" + a.ToString(), 1)%>Adiar</td>
    <td class="style4"><%:Html.RadioButton("opcao" + a.ToString(), 2)%>Cumprida <%:Html.ValidationMessage("opcao"+a.ToString())%></td>
    <td class="style5">Dia<select name="<%:dia %>"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select></td>
    <td class="style5">Mês<select name="<%:mes %>"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select><%:Html.ValidationMessage("data"+a.ToString())%></td>
    <td class="style5">Ano<select name="<%:ano %>"><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option></select></td>
    <%Session[a.ToString()] = tarif;%>
    <%a++;%>
    
    </tr>

    
    <%} %>
    
    <%}%>
    </table> 
   
    </body>


</asp:Content>
